package com.proj.hot.login;



import java.io.StringReader;
import java.util.HashMap;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;

public class ReaderXmlTools {

    public static HashMap<String, String> parse(String protocolXML) {
	SAXhandler sHandler = new SAXhandler();
	try {
	    SAXParserFactory saxfac = SAXParserFactory.newInstance();
	    SAXParser saxparser = saxfac.newSAXParser();
	    saxparser.parse(new InputSource(new StringReader(protocolXML)),
		    sHandler);
	} catch (Exception e) {
	    e.printStackTrace();
	}
	return sHandler.getHashMap();
    }

}
